<template>
<!--  <router-view></router-view>-->
  <footer class="footer_guide">
    <!--
    对象语法：判断路径是否为当前路径，是的话标签on为true变绿色
    点击今天 goto去对应路由路径
    -->
    <a href="javascript:;" class="guide_item" :class='{on:"/Msite"==$route.path}'
       @click='goTo("/Msite")'>
            <span class="item_icon">
                <i class="iconfont icon-waimai"></i>
            </span>
      <span>外卖</span>
    </a>
    <a href="javascript:;" class="guide_item" :class='{on:"/Search"==$route.path}'
       @click='goTo("/Search")'>
            <span class="item_icon">
                <i class="iconfont icon-search"></i>
            </span>
      <span>搜索</span>
    </a>
    <a href="javascript:;" class="guide_item" :class='{on:"/Order"==$route.path}'
       @click='goTo("/Order")'>
            <span class="item_icon">
                <i class="iconfont icon-dingdan"></i>
            </span>
      <span>订单</span>
    </a>
    <a href="javascript:;" class="guide_item" :class='{on:"/Profile"==$route.path}'
       @click='goTo("/Profile")'>
            <span class="item_icon">
                <i class="iconfont icon-geren"></i>
            </span>
      <span>我的</span>
    </a>
  </footer>
</template>

<script>
  export default {
    methods: {
      goTo(path) {
        this.$router.replace(path)
      }
    }
  }
</script>

<style lang='stylus' rel='stylesheet/stylus'>
  @import '../../common/stylus/mixins.styl'
  .footer_guide //footer
    top-border-1px(#e4e4e4)
    position fixed
    z-index 100
    left 0
    right 0
    bottom 0
    background-color #fff
    width 100%
    height 50px
    display flex

    .guide_item
      display flex
      flex 1
      text-align center
      flex-direction column
      align-items center
      margin 5px
      color #999999

      &.on
        color #02a774

      span
        font-size 12px
        margin-top 2px
        margin-bottom 2px

        .iconfont
          font-size 22px
</style>
